package com.cn.yugan.Engine.Http;

import android.content.Context;
import android.content.SharedPreferences;

import com.cn.yugan.Utils.StringConv;


/**
 * Created by Rover on 2016/10/10 .
 * Email 357319517@qq.com
 */
public class GetRespInfo {

    private static SharedPreferences sharedPreferences;

    public static String getuid(Context context) {
        sharedPreferences = context.getSharedPreferences("Session", Context.MODE_PRIVATE);
        String uid = sharedPreferences.getString("uid", null);
        return uid.substring(uid.indexOf("=") + 1, uid.indexOf(";"));
    }

    public static String getusername(Context context) {
        sharedPreferences = context.getSharedPreferences("Session", Context.MODE_PRIVATE);
        String username = sharedPreferences.getString("name", null);
        return StringConv.URLcode2UTF8(username.substring(username.indexOf("=") + 1, username.indexOf(";")));
    }

    public static String getuserintro(Context context) {
        sharedPreferences = context.getSharedPreferences("Session", Context.MODE_PRIVATE);
        String userintro = sharedPreferences.getString("intro", null);
        return StringConv.URLcode2UTF8(userintro.substring(userintro.indexOf("=") + 1, userintro.indexOf(";")));
    }

    public static String getLogintime(Context context) {
        sharedPreferences = context.getSharedPreferences("Session", Context.MODE_PRIVATE);
        String time = sharedPreferences.getString("time", null);
        return time.substring(time.indexOf("=") + 1, time.indexOf(";"));
    }


}
